package com.zsl.provider.ctrl;

import com.zsl.provider.service.OperationConsumerService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.Map;

/**
 * openfeign 测试服务
 * 模式消费者，正常应该在另一个项目
 * 调用生产者提供的sdk调用---> 依赖OperationApi
 */
@RestController
public class OperationConsumerCtrl {

	@Resource
	private OperationConsumerService operationConsumerService;

	@GetMapping("/getOK")
	public String getProviderStatus(String word){
		return operationConsumerService.getOK(word);

	}


	@GetMapping("/setUser")
	public String setUser(){
		Map<String, String> user = Collections.singletonMap("name", "OperationConsumer");
		return operationConsumerService.setUser(user);
	}
}
